<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>仿真任务列表</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
var showProcInstBox;
function viewInstanceRequest(){
	if (isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	if (!showProcInstBox){
		showProcInstBox = new PopupBox('showProcInstBox','流程定义图',{width:'900px',height:'500px',top:'10px',scroll:'yes'});		
	}	
	var url = "index?WfProcessInstanceView&actionType=prepareDisplay&WFIP_ID="+$('#WFIP_ID').val() +"&WFP_ID="+$('#WFP_ID').val();
	showProcInstBox.sendRequest(url);
}

function viewTaskDetail(){
	if (!isSelectedRow()){
		writeErrorMsg('请先选中一条记录!');
		return;		
	}
	doSubmit({actionType:'redirect'})
}
var selectUserBox;
function selectUserRequest(){
	if (!selectUserBox){
		selectUserBox = new PopupBox('selectUserBox','选择用户',{size:'big',height:'420px',width:'300px',top:'10px'});		
	}
	var url = 'index?SingleUserTreeSelect';
	selectUserBox.sendRequest(url);
}
var processdBox;
function openProcessBox(){
	var handlerId = "SingleProcessListSelect"; 
	if (!processdBox){
		processdBox = new PopupBox('processdBox','选择流程',{size:'normal',width:'400',top:'2px'});
	}
	var url = 'index?'+handlerId+'&targetId=WFP_ID&targetName=WFP_NAME';
	processdBox.sendRequest(url);
} 
function resetRequest(){
	$("#HIS_STYLE").val("HIS_PROCESS");
	$("#WFP_NAME").val("");
	$("#WFP_ID").val("");
	$("#userId").val("");
	$("#userName").val("");
	doSubmit({actionType:'prepareDisplay'});	
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ToolBar__">
<table border="0" cellpadding="0" cellspacing="1">
<tr height="24px;">
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="V" class="bartdx" align="center" onClick="viewInstanceRequest()"><input value="&nbsp;" type="button" class="flowStateImgBtn" title=流程图" />流程图</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" hotKey="B" class="bartdx" align="center" onClick="goToMain();"><input value="&nbsp;" type="button" class="backImgBtn" title="返回" />返回</td>        
</tr>
</table>
</div>
<div id="__ParamBar__">
<table class="queryTable"><tr><td>
&nbsp;开始日期&nbsp;<input id="sdate" label="开始时间" name="sdate" type="text" value="<%=pageBean.inputDate("sdate")%>" size="10" class="text" readonly="readonly"/><img id="sdatePicker" src="images/calendar.gif" width="16" height="16" alt="日期/时间选择框" />
-<input id="edate" label="截止时间" name="edate" type="text" value="<%=pageBean.inputDate("edate")%>" size="10" class="text"  readonly="readonly"/><img id="edatePicker" src="images/calendar.gif" width="16" height="16" alt="日期/时间选择框" />
&nbsp;&nbsp;&nbsp;&nbsp;
状态&nbsp;<select id="HIS_STYLE" label="状态" name="HIS_STYLE" class="select" onchange="doQuery()"><%=pageBean.selectValue("HIS_STYLE")%></select>
&nbsp;&nbsp;&nbsp;&nbsp;
流程名称
<input id="WFP_NAME" name="WFP_NAME" type="text" value="<%=pageBean.inputValue("WFP_NAME")%>" readonly="readonly" size="16" class="text" ondblclick="emptyText('WFP_NAME')" />
<input type="hidden" id="WFP_ID" name="WFP_ID" value="<%=pageBean.inputValue("WFP_ID")%>" /><img id="processIdSelectImage" src="images/sta.gif" width="16" height="16" onclick="openProcessBox()" />
&nbsp;&nbsp;&nbsp;&nbsp;
<% 
if (pageBean.getBoolValue("embed")){
%>
当前用户
<input name="userName" type="text" class="text" id="userName" ondblclick="selectUserRequest()" value="<%=pageBean.inputValue("userName")%>" size="16" maxlength="16" readonly="readonly" />
<input name="userId" type="hidden" id="userId" value="<%=pageBean.inputValue("userId")%>" /><img src="images/query.gif" width="16" height="16" onclick="selectUserRequest()" style="cursor:pointer" />
&nbsp;&nbsp;&nbsp;&nbsp;
<%}%>
<input type="button" name="button" id="button" value="重置" class="formbutton" onclick="resetRequest()" />
</td></tr></table>
</div>
<%
if("HIS_PROCESS".equals(pageBean.getStringValue("hisStyle"))){ 
%>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="历史流程查询列表.csv"
retrieveRowsCallback="process" xlsFileName="历史流程查询列表.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="400px" 
>
<ec:row styleClass="odd" ondblclick="viewInstanceRequest()" onclick="selectRow(this,{WFHP_ID:'${row.WFHP_ID}',WFIP_ID:'${row.WFIP_ID}',WFP_ID:'${row.WF_ID}'});">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="140" property="WFP_NAME" title="流程名称"   />
	<ec:column width="180" property="WFHP_TITLE" title="业务标题"   />
	<ec:column width="100" property="WFHP_LANCHER_NAME" title="发起人"   />
	<ec:column width="140" property="WFHP_LANCH_TIME" title="发起时间"  cell="date" format="yyyy-MM-dd HH:mm" />
	<ec:column width="100" property="WFHP_COMPLETER_NAME" title="完成人"   />
	<ec:column width="140" property="WFHP_COMPLETER_TIME" title="完成时间"  cell="date" format="yyyy-MM-dd HH:mm" />	
</ec:row>
</ec:table>
<%}else{%>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="历史流程查询列表.csv"
retrieveRowsCallback="process" xlsFileName="历史流程查询列表.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="400px" 
>
<ec:row styleClass="odd" ondblclick="viewInstanceRequest()" onclick="selectRow(this,{WFIP_ID:'${row.WFIP_ID}',WFP_ID:'${row.WFP_ID}'});">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="140" property="WFP_NAME" title="流程名称"   />
	<ec:column width="180" property="WFIA_TITLE" title="业务标题"   />
	<ec:column width="180" property="WFA_NAME" title="节点名称"   />
	<ec:column width="100" property="WFHA_OPERTER_NAME" title="参与人"   />
	<ec:column width="140" property="WFHA_OPERTE_TIME" title="参与时间"  cell="date" format="yyyy-MM-dd HH:mm" />
</ec:row>
</ec:table>
<%}%>
<input type="hidden" name="bizFormURL" id="bizFormURL" value="" />
<input type="hidden" name="bizRecordId" id="bizRecordId" value="" />
<input type="hidden" name="processId" id="processId" value="" />
<input type="hidden" name="activityCode" id="activityCode" value="" />
<input type="hidden" name="processInstId" id="processInstId" value="" />
<input type="hidden" name="actionType" id="actionType" />
<script language="JavaScript">
setRsIdTag('WFIP_ID');
initCalendar('sdate','%Y-%m-%d','sdatePicker');
datetimeValidators[0].set("yyyy-MM-dd").add("sdate");
initCalendar('edate','%Y-%m-%d','edatePicker');
datetimeValidators[0].set("yyyy-MM-dd").add("edate");
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
